using SmartLink.RedisRepository;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace SmartLink.Infrastructure.Cache
{
    public class ValidateCodeCache
    {
        private const string _redisKeyPre = RedisKeyPre.ValidateCode;

        public static bool SetValidateCode(string openId, string validCode)
        {
            return RedisManager.GetInstance().HashSet(_redisKeyPre, openId,validCode);
        }
        
        public static string GetValidateCode(string openId)
        {
            return RedisManager.GetInstance().HashGet(_redisKeyPre,openId);
        }
        public static bool DeleteValidateCode(string openId)
        {
            return RedisManager.GetInstance().HashDelete(_redisKeyPre, openId);
        }

    }
}
